home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "MainModule"
- Option Explicit
-
- Public Declare Function GetModuleHandle Lib "KERNEL32.dll" _
- Alias "GetModuleHandleA" (ByVal Module As Any) As Long
-
- Public ExcludeThem(5) As Long
- Public KnownBasDlls(4) As String
- Function GetFuncAddr(lpFuncAddr As Long) As Long
- GetFuncAddr = lpFuncAddr
- End Function
- Function NewGetVersion() As Long
- NewGetVersion = 9
- End Function
- Sub Main()
- KnownBasDlls(0) = "cap.dll"
- KnownBasDlls(1) = "apihooks.dll"
- KnownBasDlls(2) = "msvbvm60.dll"
- KnownBasDlls(3) = "ole32.dll"
- KnownBasDlls(4) = "oleaut32.dll"
-
- Dim i As Long, j As Long
- Dim hinst As Long
-
- For i = 0 To 4
- hinst = GetModuleHandle(KnownBasDlls(i))
- If hinst Then
- ExcludeThem(j) = hinst
- j = j + 1
- End If
- Next
- ExcludeThem(j) = 0
-
- If HookApi("kernel32.dll", "GetVersion", HOOK_ALL, ALL_MODULES, 0&, GetFuncAddr(AddressOf NewGetVersion), 0&) = ErrorSuccess Then
- MsgBox "GetVersion hooked!", vbOKOnly, "AH in VB"
- Else
- MsgBox "GetVersion not hooked!", vbOKOnly, "AH in VB"
- End If
- End Sub
-